package cn.iocoder.yudao.module.resource.api;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.resource.api.model.UserTimeBalanceDTO;
import cn.iocoder.yudao.module.resource.dal.dataobject.usertimebalance.UserTimeBalanceDO;
import cn.iocoder.yudao.module.resource.service.usertimebalance.UserTimeBalanceService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class UserTimeBalanceApiImpl implements IUserTimeBalanceApi {
    @Resource
    private UserTimeBalanceService userTimeBalanceService;

    @Override
    public UserTimeBalanceDTO getUserTimeBalanceByUserId(Long userId) {
        final UserTimeBalanceDO record = userTimeBalanceService.getUserTimeBalanceByUserId(userId);
        return BeanUtils.toBean(record, UserTimeBalanceDTO.class);
    }

    @Override
    public UserTimeBalanceDTO getUserTimeBalanceByUserIdWithNewUserGive(Long userId) {
        final UserTimeBalanceDO record = userTimeBalanceService.getUserTimeBalanceByUserIdWithNewUserGive(userId);
        return BeanUtils.toBean(record, UserTimeBalanceDTO.class);
    }
}
